var back = document.getElementById("back");
var mima = document.getElementById("mima");
var zhuce = document.getElementById("zhuce");
var submit1 = document.getElementById("submit1");
back.addEventListener("touchstart", function() {
	window.history.go(-1);
})

mima.addEventListener("touchstart", function(event) {
	event.preventDefault();
	this.style.background = "#e0f5fa";
	window.location.href = "mi_ma.html";
})
mima.addEventListener("touchend", function(event) {
	event.preventDefault();
	this.style.background = "transparent";
})
zhuce.addEventListener("touchstart", function(event) {
	event.preventDefault();
	this.style.background = "#e0f5fa";
	window.location.href = "zhu_ce.html";
})
zhuce.addEventListener("touchend", function(event) {
	event.preventDefault();
	this.style.background = "transparent";
})

var zh = document.querySelector("#zh");
var pwd = document.querySelector("#pwd");
submit1.addEventListener("touchstart", function(event) {
	event.preventDefault();
	this.style.background = "#e8201e";
	var zh1 = document.querySelector("#zh").value;
	var pwd1 = document.querySelector("#pwd").value;
	if(zh1 == "") {
		zh.placeholder = "请输入账号";
		zh.setAttribute("class", "name2");
	}
	if(zh1 != "" && !/^[1][3,4,5,7,8][0-9]{9}$/.test(zh1)) {
		zh.value = "";
		zh.placeholder = "请输入正确账号";
		zh.setAttribute("class", "name");
	}
	if(/^[1][3,4,5,7,8][0-9]{9}$/.test(zh1) && pwd1 == "") {
		pwd.placeholder = "请输入密码";
		pwd.setAttribute("class", "name2");
	}
	if(/^[1][3,4,5,7,8][0-9]{9}$/.test(zh1) && pwd1 != "" && pwd1.length < 6) {
		pwd.value = "";
		pwd.placeholder = "密码不正确";
		pwd.setAttribute("class", "name");
	}
})
submit1.addEventListener("touchend", function(event) {
	this.style.background = "#f23a38";
})